﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExcelImportHelper
{
    /// <summary>
    /// Excel数据类型
    /// </summary>
    public enum eFieldDataType
    {
        /// <summary>
        /// 数字型
        /// </summary>
        Int,
        /// <summary>
        /// float
        /// </summary> 
        Float,
        /// <summary>
        /// double
        /// </summary>
        Double,
        /// <summary>
        /// datetime
        /// </summary>
        Datetime,
        /// <summary>
        /// 文本类型Varchar，Nchar，NVarchar，Text
        /// </summary>
        String
    }

    /// <summary>
    /// 标注需要使用的Sheet工作簿
    /// </summary>
    public class ExcelSheetAttribute : Attribute
    {
        public ExcelSheetAttribute()
        { }
        public ExcelSheetAttribute(string sheetname)
        {
            SheetName = sheetname;
        }

        /// <summary>
        /// Sheet名称
        /// </summary>
        public string SheetName { get; set; }

        /// <summary>
        /// 是否检查没有标注导入属性的字段
        /// </summary>
        public bool CheckPropertyName { get; set; }

    }

    /// <summary>
    /// 标注需要使用的属性
    /// </summary>
    public class ExcelFieldAttribute : Attribute
    {
        /// <summary>
        /// Excel列名称
        /// </summary>
        public string Name { get; set; }


        /// <summary>
        /// 字段类型
        /// </summary>
        public eFieldDataType DataType { get; set; }

        /// <summary>
        /// 默认值
        /// </summary>
        public string DefaultVal { get; set; }



    }
}
